﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        if (!!keyValue) {
            $.ajax({
                url: "/sso/SubSystem/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });
    function initControl() {
        $("#F_Enable").bindSelect();
        $("#F_User_Id").bindSelect({
            url: "/SSO/SubSystem/GetUserList",
            id: "F_Id",
            text: "F_RealName"
        });
        $("#F_Authentication_Id").bindSelect({
            url: "/SSO/SsoAuthentication/GetEnableList",
            id: "Sa_Id",
            text: "Sa_App_Name"
        });
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/SSO/SubSystem/Add?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>
<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">关联子系统</a></li>
        </ul>
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                <tr class="hide">
                    <th class="formTitle">ID</th>
                    <td class="formValue">
                        <input id="F_Id" name="F_Id" type="text" class="form-control" />
                    </td>

                </tr>
                <tr>
                    <th class="formTitle">姓名</th>
                    <td class="formValue">
                        <select id="F_User_Id" name="F_User_Id" class="form-control required"></select>
                    </td>
                </tr>
                
                <tr>
                    <th class="formTitle">应用名称</th>
                    <td class="formValue">
                        <select id="F_Authentication_Id" name="F_Authentication_Id" class="form-control required">
                        </select>
                    </td>
                </tr>                
                <tr>
                    <th class="formTitle">子系统用户名</th>
                    <td class="formValue">
                        <input id="F_Username" name="F_Username" type="text" class="form-control" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">子系统密码</th>
                    <td class="formValue">
                        <input id="F_Password" name="F_Password" type="password" class="form-control" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">启用</th>
                    <td class="formValue">
                        <select id="F_Enable" name="F_Enable" class="form-control">
                            <option value="0">启用</option>
                            <option value="1">禁用</option>
                        </select>
                    </td>
                    <td></td>
                </tr>
                <tr class="hide">
                    <th class="formTitle">创建时间</th>
                    <td class="formValue">
                        <input id="F_CreateTime" name="F_CreateTime" type="text" class="form-control" />
                    </td>
                    <th class="formTitle">更新时间</th>
                    <td class="formValue">
                        <input id="F_UpdateTime" name="F_UpdateTime" type="text" class="form-control" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
